Page({
    data: {
        animationData: {}
    },
    onShow: function () {
        var animation = wx.createAnimation({
            duration: 300,
            timingFunction: 'linear',
        })

        this.animation = animation

        // animation.translate(0, 100).step()

        // this.setData({
        //     animationData: animation.export()
        // })

        // setTimeout(function () {
        //     animation.translate(0,100).step()
        //     this.setData({
        //         animationData: animation.export()
        //     })
        // }.bind(this), 1000)
    },
    rotateAndScale: function () {
        // 旋转同时放大
        this.animation.height(200).step()
        this.setData({
            animationData: this.animation.export()
        })
    },
    rotateAndScale1: function () {
        // 旋转同时放大
        this.animation.height(100).step()
        this.setData({
            animationData: this.animation.export()
        })
    },
    rotateThenScale: function () {
        // 先旋转后放大
        this.animation.rotate(45).step()
        this.animation.scale(2, 2).step()
        this.setData({
            animationData: this.animation.export()
        })
    },
    rotateAndScaleThenTranslate: function () {
        // 先旋转同时放大，然后平移
        this.animation.rotate(45).scale(2, 2).step()
        this.animation.translate(100, 100).step({ duration: 1000 })
        this.setData({
            animationData: this.animation.export()
        })
    }
})